#include "TempUI.h"

TempUI::TempUI() {
	cout << MESSAGE_INITIAL;
	getline(cin,_owner);
}

void TempUI::executeCommand() {
	TaskItScheduler scheduler;
	scheduler.setOwnerName(getOwnerName());
	string command, criteria, keyword, itemNumber;

	cout << scheduler.initialWelcome();
	
	while(true) {
		getline(cin,command);
		cout << scheduler.executeCommand(command);
		/*if(command == "add") {
			cout << scheduler.executeCommand(command, "I want to eat breakfast", "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "y") {
			cout << scheduler.executeCommand(command, "I want to eat breakfast", "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "n") {
			cout << scheduler.executeCommand(command, "I want to eat breakfast", "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "delete") {
			cin >> itemNumber;
			cout << scheduler.executeCommand(command, itemNumber, "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "edit") {
			cin >> itemNumber;
			cout << scheduler.executeCommand(command, itemNumber, "I want to eat lunch", "Kopitiam", "1300", "1400", "Food", "120214");
		} else if(command == "view") {
			cin >> criteria;
			cout << scheduler.executeCommand(command, criteria, "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "mark") {
			cin >> itemNumber;
			cout << scheduler.executeCommand(command, itemNumber, "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "undo") {
			cout << scheduler.executeCommand(command, "I want to eat breakfast", "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "help") {
			cout << scheduler.executeCommand(command, "I want to eat breakfast", "Hola", "0900", "1000", "Food", "110114", "-1");
		} else if(command == "search") {
			cin >> keyword;
			cout << scheduler.executeCommand(command, keyword, "Hola", "0900", "1000", "Food", "110114", "-1");
		} else {
			cout << scheduler.executeCommand(command, "aaa", "Hola", "0900", "1000", "Food", "110114", "-1");
		}*/
	};
}

void TempUI::displayInitialCommand(string display) {
	cout << display;
}

string TempUI::getOwnerName() {
	return _owner;
}